<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:60:"D:\www\fdc\public/../application/manage\view\rental\add.html";i:1492066838;s:63:"D:\www\fdc\public/../application/manage\view\public\header.html";i:1490355172;s:63:"D:\www\fdc\public/../application/manage\view\public\footer.html";i:1474280020;}*/ ?>
<!doctype html>
<html>
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<link href="__CSS__/style.css" rel="stylesheet"/>
	<title>管理中心</title>

</head>

<body>
<div id="J_ajax_loading" class="ajax_loading">加载中...</div>

<div class="subnav">
    <div class="content_menu ib_a blue line_x">
        <?php if(!empty($sub_menu) OR !empty($big_menu)): if(!(empty($big_menu) || (($big_menu instanceof \think\Collection || $big_menu instanceof \think\Paginator ) && $big_menu->isEmpty()))): if(isset($normal)): ?>
        <a class="add fb" href="<?php echo $big_menu['iframe']; ?>"><em><?php echo $big_menu['title']; ?></em></a>
        <?php else: ?>
    	<a class="add fb J_showdialog" href="javascript:void(0);" data-uri="<?php echo $big_menu['iframe']; ?>" data-title="<?php echo $big_menu['title']; ?>" data-id="<?php echo $big_menu['id']; ?>" data-width="<?php echo $big_menu['width']; ?>" data-height="<?php echo $big_menu['height']; ?>"><em><?php echo $big_menu['title']; ?></em></a>
        <?php endif; endif; if(!(empty($sub_menu) || (($sub_menu instanceof \think\Collection || $sub_menu instanceof \think\Paginator ) && $sub_menu->isEmpty()))): if(is_array($sub_menu) || $sub_menu instanceof \think\Collection || $sub_menu instanceof \think\Paginator): $key = 0; $__LIST__ = $sub_menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($key % 2 );++$key;if($key != 1): ?><span>|</span><?php endif; ?>
        <a href="<?php echo $val['url']; ?>" class="<?php echo $val['class']; ?>"><em><?php echo $val['name']; ?></em></a>
        <?php endforeach; endif; else: echo "" ;endif; endif; endif; ?>
    </div>
</div>

<!--添加出租房-->
<form id="info_form" action="<?php echo url('addDo'); ?>" method="post" enctype="multipart/form-data">
<div class="pad_lr_10">
	<div class="col_tab">
		<ul class="J_tabs tab_but cu_li">
			<li class="current">房源信息</li>
            <li>SEO设置</li>
		</ul>
		<div class="J_panes">
			<div class="content_list pad_10">
				<table width="100%" cellspacing="0" class="table_form">
                    <tr>
                        <th style="width: 120px">所属小区 :</th>
                        <td>
                            <select name="estate_id" id="estate_id" data-uri="<?php echo url('getEstateInfo'); ?>">
                                <option value="0">--请选择--</option>
                                <?php if(is_array($estate_list) || $estate_list instanceof \think\Collection || $estate_list instanceof \think\Paginator): $i = 0; $__LIST__ = $estate_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                                    <option value="<?php echo $vo['id']; ?>"><?php echo $vo['title']; ?></option>
                                <?php endforeach; endif; else: echo "" ;endif; ?>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th width="120">所属区域 :</th>
                        <td>
                            <select class="J_cate_select mr10" data-pid="0" data-uri="<?php echo url('City/ajaxGetchilds'); ?>" data-selected=""></select>
                            <input type="hidden" name="area" id="J_cate_id" value="" />
                        </td>
                    </tr>
		            <tr>
						<th>房源名称 :</th>
						<td>
							<input type="text" name="title" id="J_title" class="input-text" size="40">
                        </td>
					</tr>
                    <tr>
                        <th>户型 :</th>
                        <td>
                            <input type="text" class="input-text" size="5" name="room" value="1"><span>室</span>
                            <input type="text" class="input-text" size="5" name="ting" value="1"><span>厅</span>
                            <input type="text" class="input-text" size="5" name="wei" value="1"><span>卫</span>
                            <input type="text" class="input-text" size="5" name="chu" value="1"><span>厨</span>
                            <input type="text" class="input-text" size="5" name="yang" value="0"><span>阳台</span>
                        </td>
                    </tr>
                    <tr>
                       <th>价格 :</th>
                        <td>
                                    月租价 :
                                    <input type="text" name="price" id="price" class="input-text" size="5"/><span>元/月</span>
                                    押金 :
                                   <input type="text" name="yajin" id="yajin" class="input-text" size="5"/><span>元</span>
                            面积 :
                            <input type="text" name="mianji" id="mianji" class="input-text" size="5"/><span>平米</span>
                        </td>
                    </tr>
                    <tr>
                        <th>楼层 :</th>
                        <td>&nbsp;&nbsp;&nbsp;&nbsp; 第 :<input type="text" name="floor" class="input-text" size="5"><span>层</span>
                            共<input type="text" name="total_floor" class="input-text" size="5"><span>层</span>
                        </td>
                    </tr>
                    <tr>
                        <th>楼房类型 :</th>
                        <td><?php echo getLinkMenu(7,'house_type','checkbox'); ?></td>
                    </tr>
                    <tr>
                        <th>装修情况 :</th>
                        <td><?php echo getLinkMenu(9,'zhuangxiu','radio'); ?></td>
                    </tr>
                    <tr>
                        <th>朝向 :</th>
                        <td><?php echo getLinkMenu(12,'chaoxiang','radio'); ?></td>
                    </tr>
                    <tr>
                        <th>出租方式 :</th>
                        <td><?php echo getLinkMenu(14,'rental_type','radio'); ?></td>
                    </tr>
                    <tr>
                        <th>支付方式 :</th>
                        <td><?php echo getLinkMenu(15,'rental_pay','radio'); ?></td>
                    </tr>
                    <tr>
                        <th>房屋配套 :</th>
                        <td><?php echo getLinkMenu(13,'peitao','checkbox'); ?></td>
                    </tr>

                    <tr>
                        <th>建筑年代 :</th>
                        <td><input type="text" name="niandai" id="niandai" size="10" class="input-text"> 年</td>
                    </tr>
                    <tr>
                        <th>特色 :</th>
                        <td><textarea name="tese" id="tese" style="width:680px;height:50px;resize: none;"></textarea></td>
                    </tr>
                    <tr>
                        <th>所在地址 :</th>
                        <td><input type="text" name="address" id="address" class="input-text" size="60"/> </td>
                    </tr>
                    <tr>
                        <th>地图标注：</th>
                        <td>
                            <input type="text" name="map" id="map" class="input-text" size="27"/>
                            &nbsp;&nbsp;<a href="http://api.map.baidu.com/lbsapi/getpoint/" style="padding: 8px;color:#ffffff;background: #008000" target="_blank">获取百度地图坐标</a>
                        </td>
                    </tr>
                    <tr>
                        <th>缩略图:</th>
                        <td><input type="file" name="img" id="img" class="input-text"  style="width:200px;" /></td>
                    </tr>
                    <tr>
                        <th>房源图片 :</th>
                        <td><script id="uploadpic" name="uploadpic" type="text/plain"></script>
                            <input type="button" class="btn btn_submit" style="margin:0 0 10px 10px;" onclick="upImage();" value="选择图片">
                            <div id="imageList">
                                <ul class="list clearfix">
                                </ul>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th>联系人 :</th>
                        <td>
                            <input type="text" name="contact" id="contact" class="input-text" size="20"/>
                            联系电话 :
                            <input type="text" name="contact_phone" id="contact_phone" class="input-text" size="20"/>
                        </td>
                    </tr>
                    <tr>
                        <th>推荐位 :</th>
                        <td>
                            <?php if(is_array($pos_list) || $pos_list instanceof \think\Collection || $pos_list instanceof \think\Paginator): $i = 0; $__LIST__ = $pos_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                            <label><input type="checkbox" name="position[]" value="<?php echo $vo['id']; ?>"><?php echo $vo['title']; ?></label>
                            <?php endforeach; endif; else: echo "" ;endif; ?>
                        </td>
                    </tr>
                    <tr>
                        <th>状态 :</th>
                        <td>
                            <label><input type="radio" name="status" class="radio_style" value="1" checked="checked"> 启用 </label>&nbsp;&nbsp;
                            <label><input type="radio" name="status" class="radio_style" value="0" >禁用</label>
                        </td>
                    </tr>
                    <tr>
                        <th>急租房源:</th>
                        <td>
                            <label><input type="radio" name="jizu" class="radio_style" value="1"> 是 </label>&nbsp;
                            <label><input type="radio" name="jizu" class="radio_style" value="0" checked="checked"> 否</label>
                            &nbsp;&nbsp;
                            房源来源:
                            <label><input type="radio" name="user_type" class="radio_style" value="1" checked="checked">个人</label>&nbsp;
                            <label><input type="radio" name="user_type" class="radio_style" value="2"  >中介/公司</label>
                        </td>
                    </tr>
                    <tr>
                        <th>房源介绍 :</th>
                        <td><textarea name="info" id="info"></textarea></td>
                    </tr>
				</table>
			</div>
            <div class="content_list pad_10 hidden">
                <table width="100%" cellspacing="0" class="table_form">
                    <tr>
                        <th width="120">seo标题 :</th>
                        <td><input type="text" name="seo_title" id="seo_title" class="input-text" size="60"></td>
                    </tr>
                    <tr>
                        <th>seo关键词 :</th>
                        <td><input type="text" name="seo_keys" id="seo_keys" class="input-text" size="60"></td>
                    </tr>
                    <tr>
                        <th>seo描述 :</th>
                        <td><textarea name="seo_desc" id="seo_desc" cols="80" rows="8"></textarea></td>
                    </tr>
                </table>
            </div>
            <input type="hidden" name="estate_name" id="estate_name">
            </div>
		<div class="mt10"><input type="submit" value="提交" id="dosubmit" name="dosubmit" class="btn btn_submit" style="margin:0 0 10px 100px;"><br /><br /><br /></div>
	</div>
</div>
</form>
<script src="__PUBLIC__/js/jquery.min.1.7.2.js"></script>
<script src="__JS__/manage.js"></script>
<script src="__JS__/admin.js"></script>
<script>
//初始化弹窗
(function (d) {
    d['okValue'] = '确定';
    d['cancelValue'] = '取消';
    d['title'] = '标题';
})($.dialog.defaults);
</script>
<script src="__PUBLIC__/js/plugins/formvalidator.js"></script>
<?php if(isset($list_table)): ?>
<script src="__PUBLIC__/js/plugins/listTable.js"></script>
<script>
$(function(){
	$('.J_tablelist').listTable();
});
</script>
<?php endif; ?>
<script src="__PUBLIC__/js/plugins/jquery.tools.min.js"></script>
<script src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
<script src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
<script src="__PUBLIC__/js/ueditor/lang/zh-cn/zh-cn.js"></script>
<script src="__PUBLIC__/js/ueditor/uploadImg.js"></script>
<script type="text/javascript">
    window.UEDITOR_HOME_URL='__PUBLIC__/js/ueditor/';
    window.onload=function(){
        window.UEDITOR_CONFIG.initialFrameWidth=880;
        window.UEDITOR_CONFIG.initialFrameHeight=500;
        UE.getEditor('info',{autoFloatEnabled:false});
        upmoreimg();
    }
</script>
<script type="text/javascript">
    var check_name_url = "<?php echo url('ajaxCheckTitle'); ?>";
    $(function(){
        $('ul.J_tabs').tabs('div.J_panes > div');
        $('.J_cate_select').cate_select({type:'str'});
        $.formValidator.initConfig({formid:"info_form",autotip:true});
        $("#estate_id").formValidator({onshow:'请选择小区',onfocus:'请选择小区'}).regexValidator({regexp:"intege1",datatype:"enum",onerror:"请选择小区"});
        $("#J_cate_id").formValidator({onshow:"请选择区域",onfocus:"请选择区域"}).inputValidator({min:1,onerror:"请选择区域"});
        $("#J_title").formValidator({onshow:"请填写房源名称",onfocus:"请填写房源名称"}).inputValidator({min:1,onerror:"请填写房源名称"}).ajaxValidator({
            type : "get",
            url : check_name_url,
            datatype : "json",
            async:'false',
            success : function(result){
                if(result.status == 0){
                    return false;
                }else{
                    return true;
                }
            },
            buttons: $("#dosubmit"),
            onerror : "请填写房源名称",
            onwait : "正在验证"
        });
        $(":radio[name^='zhuangxiu']").formValidator({onshow:"请选择装修情况",onfocus:"请选择装修情况"}).inputValidator({min:1,max:10,onerror:"请选择装修情况"});
        $(":radio[name^='chaoxiang']").formValidator({onshow:"请选择朝向",onfocus:"请选择朝向"}).inputValidator({min:1,max:10,onerror:"请选择朝向"});
        $(":radio[name^='rental_type']").formValidator({onshow:"请选择出租方式",onfocus:"请选择出租方式"}).inputValidator({min:1,max:10,onerror:"请选择出租方式"});
        $(":radio[name^='rental_pay']").formValidator({onshow:"请选择支付方式",onfocus:"请选择支付方式"}).inputValidator({min:1,max:10,onerror:"请选择支付方式"});
        $(":checkbox[name^='house_type']").formValidator({onshow:"请选择楼盘类型",onfocus:"你至少选择1项"}).inputValidator({min:1,max:10,onerror:"请至少选择一项"});
        $("#estate_id").bind('change',function(){
            var url = $(this).data('uri'),id = $(this).val();
            var param = {id:id};
            $.get(url,param,function(res){
                if(res.status == 1){
                    $('#niandai').val(res.data.niandai);
                    $('#address').val(res.data.address);
                    $('#map').val(res.data.map);
                    $('#estate_name').val(res.data.title);
                }
            });
        });
    });
   </script>
</body>
</html>